import { createSlice } from "@reduxjs/toolkit";

export const UserSlice = createSlice({
  name: "UserSlice",
  initialState: {
    token: "",
    userInfo: {},
  },
  reducers: {
    setUserStrote(state, { payload }) {
      state.token = payload.token;
      state.userInfo = payload.userInfo;
    },
  },
});

// Action creators are generated for each case reducer function
export const { setUserStrote } = UserSlice.actions;

export default UserSlice.reducer;
